<?php
$root = dirname(__FILE__);
require_once $root . '/CClsImage.php';
mysql_connect('localhost', 'root', 'mmm123456');
mysql_select_db('newjerseysoccer');
$sql = 'select * from zcshop_attachments order by attachmentid desc';
$result = mysql_query($sql);
$img = new CClsImage();
while ($row = mysql_fetch_array($result)) {
	$srcPath = $root . '/' . $row['attachment_url'];
	$toPath = str_replace('cut_item_img', 'new_cut_item_img', $row['cut_url']);
	$toPathArr = pathinfo($toPath);
	$newFile = $img->make_thumb($srcPath, 260, 0, $root . '/' . $toPathArr['dirname'], '', $toPathArr['filename']);
	echo $img->error_msg;
	if ($newFile) {
		echo $toPath . " success\n\r";
	} else {
		echo $toPath . " wrong\n\r";
	}
}